﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Easy.Authorization.Models;
using Easy.Domain.Core;

namespace Easy.Authorization.Repository.Query
{
    class Aut_NavigationsQueryRepository : SqlQueryProvider<VAut_Navigations>, IAut_NavigationsQueryRepository
    {
        public Aut_NavigationsQueryRepository(IAuthorizationUnitOfWork unitOfWork)
            : base(unitOfWork)
        {

        }

        public IQueryable<VAut_Navigations> GetRootNavigation()
        {
            return GetAll("ParentId IS NULL");
        }


        public IQueryable<VAut_Navigations> GetChildrenNavigations(string navigationDispaly)
        {
            return GetAll(string.Format("RootDisplayName ='{0}'", navigationDispaly));
        }
    }
}
